#-*-coding:utf8-*-

import time
import sched

def print_time(msg):
    print("From print_time "+str(time.time()))
    print("message = "+str(msg))


def print_some_times():
    pass

if __name__=="__main__":
    print '*'*20,'start  test','*'*20
    s=sched.scheduler(time.time,time.sleep)
    print('now = '+str(time.time()))
    s.enter(5,2,print_time,('1'))
    s.enter(5,1,print_time,('2'))
    s.enter(10,1,print_time,('3'))
    print("s.empty() = "+str(s.empty()))
    print("s.queue   = "+str(s.queue))
    print("run... "+str(time.time()))
    s.run()
    print("s.empty() = "+str(s.empty()))
    print("s.queue   = "+str(s.queue))
    print(time.time())
    print '*'*20,'end of test','*'*20
    